//
//  MSLoginDataSource.h
//  MSJD
//
//  Created by 箭军刘 on 2018/10/17.
//  Copyright © 2018年 xiangbo. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface MSLoginDataSource : NSObject

/**
 登录（账号密码登录）

 @param phone 账号
 @param pwd 密码
 */
+ (void)loginWithPhone:(NSString *)phone
                   pwd:(NSString *)pwd
               success:(void (^)(NSDictionary *responseInfo))success
               failure:(void (^)(NSError *error))failure;

/**
 查询微信账号的accessToken与openId

 @param code 微信登录code
 */
+ (void)queryWechatAccountInfoAndOpenIdWithCode:(NSString *)code
                                        success:(void (^)(NSDictionary *responseInfo))success
                                        failure:(void (^)(NSError *error))failure;



/**
 微信登录

 @param phone 微信绑定的⼿手机号
 @param avatar 微信头像地址
 @param gender 微信⽤用户性别  0-未知, 1-男, 2-⼥女女
 @param openId 微信openId
 @param nickname 微信⽤用户昵称
 */
+ (void)wechatLoginWithPhone:(NSString *)phone
                      avatar:(NSString *)avatar
                      gender:(NSInteger)gender
                      openId:(NSString *)openId
                    nickname:(NSString *)nickname
                     success:(void (^)(NSDictionary *responseInfo))success
                     failure:(void (^)(NSError *error))failure;


/**
 发送短信消息

 @param phone 目标手机号码
 @param source 接口类型： 0：发送注册短信验证码  1：发送重设密码验证码 2:发送绑定手机验证码
 */
+ (void)sendSMSCodeWithPhone:(NSString *)phone
                      source:(NSInteger)source
                     success:(void (^)(NSDictionary *responseInfo))success
                     failure:(void (^)(NSError *error))failure;

/**
 重设密码

 @param urlType 请求类型  0：注册请求  1：重设密码请求
 @param phone 手机号码
 @param password 新密码
 @param code 验证码
 */
+ (void)resetPasswordWithType:(NSInteger)urlType
                        Phone:(NSString *)phone
                     password:(NSString *)password
                         code:(NSString *)code
                      codeDic:(NSDictionary *)codeDic
                      success:(void (^)(NSDictionary *responseInfo))success
                      failure:(void (^)(NSError *error))failure;

/**
 绑定手机号

 @param phone 手机号码
 @param code 验证码

 */
+ (void)bindPhoneWithPhone:(NSString *)phone
                      code:(NSString *)code
                   codeDic:(NSDictionary *)codeDic
                   success:(void (^)(NSDictionary *responseInfo))success
                   failure:(void (^)(NSError *error))failure;

/**
 查询APP审核版本信息
 */
+ (void)queryAppReviewStatus:(void (^)(NSDictionary *responseInfo))success
                     failure:(void (^)(NSError *error))failure;

@end

NS_ASSUME_NONNULL_END
